import { BasicColumn, FormProps } from '/@/components/Table';
import { getApplyReasonList } from '/@/api/telecom/telecom';

export function getBasicColumns(): BasicColumn[] {
  return [
    {
      title: '商品编号',
      dataIndex: 'productId',
      width: 160,
      align: 'center',
    },
    {
      title: '商品名称',
      dataIndex: 'productName',
      width: 160,
      align: 'center',
    },
  ];
}

export function getFormConfig(): Partial<FormProps> {
  return {
    labelWidth: 100,
    autoSubmitOnEnter: true,
    schemas: [
      {
        field: 'value',
        defaultValue: 19,
        component: 'ApiSelect',
        label: '申请理由',
        colProps: {
          span: 12,
        },
        componentProps: {
          placeholder: '请选择申请理由',
          api: getApplyReasonList,
          resultField: 'data',
          labelField: 'text',
          valueField: 'value',
        },
      },
    ],
    showSubmitButton: false,
    showResetButton: false,
  };
}
